import React, { Component } from 'react'

export default class Child extends Component {
    state = {
        count: 888
    }
    render() {
        const { count } = this.state
        const { acceptCount } = this.props
        return (
            <div>
                <h4>我是子组件----{ count }</h4>
                {/* <button onClick={ () => {
                    acceptCount(count)
                } }>点我</button> */}
            </div>
        )
    }
    componentDidMount() {
        this.props.acceptCount(this.state.count)
    }
}
